package com.chengshuang.log.factory;

import com.chengshuang.log.context.DynamicTemplatesContext;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * 自定义模板工厂
 *
 * @author shuang.cheng
 * @date 2022/10/14
 */
public class DynamicTemplatesFactory {

    private static final Map<String, Set<DynamicTemplatesContext>> DYNAMIC_TEMPLATES = new HashMap<>();

    public static Set<DynamicTemplatesContext> getTemplate(String methodName) {
        return DYNAMIC_TEMPLATES.get(methodName);
    }

    public static Map<String, Set<DynamicTemplatesContext>> getTemplates() {
        return DYNAMIC_TEMPLATES;
    }

    public static Set<DynamicTemplatesContext> putTemplate(String methodName, Set<DynamicTemplatesContext> template) {
        return DYNAMIC_TEMPLATES.put(methodName, template);
    }


}
